package com.gec.it.service.impl;

import java.util.List;

import com.gec.it.dao.DoctorsDao;
import com.gec.it.service.WorkFlowBrige;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.gec.it.dao.PowersDao;

@Service("wtf")
public class WorkFlowBrigeImpl implements WorkFlowBrige {
	@Autowired
	private PowersDao powerdao;
	@Autowired
	private DoctorsDao ddao;

	@Override
	public List<String> getPower(String type, String userkey) {
		int empId = Integer.parseInt(userkey.split("_")[0]);
		List<String> list = powerdao.selectPowerByType(type, empId);

		System.out.println("查找" + userkey + "的部门审批人");
		for (String s : list) {
			System.out.println(s);
		}
		return list;
		// int empId = Integer.parseInt(userkey.split("_")[0]);
		// Emps emp = empdao.selectById(empId);
		// int deptId = emp.getDeptid();//部门id
		//
		// QueryWrapper<Powers> qw = new QueryWrapper<>();
		// qw.lambda().eq(Powers::getType, type).eq(Powers::getDeptid, deptId);
		// List<Powers> list = powerdao.selectList(qw);
		// // 找领导
		// List<String> empList = new ArrayList<String>();
		// for (Powers p : list) {
		// empList.add(empdao.selectById(p.getEmpid()).getUserKey());
		// }
		// return empList;
	}

	// 公司审批人是谁
	@Override
	public List<String> getPower2(String type) {
		List<String> list = powerdao.selectPowerByType2(type);

		System.out.println("查找公司的部门审批人");
		for (String s : list) {
			System.out.println(s);
		}
		return list;
	}
}
